//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS Signer service.
///
/// AWS Signer is a fully managed code-signing service to help you ensure the trust and
/// 			integrity of your code.
/// 		       Signer supports the following applications:
/// 		       With code signing for AWS Lambda, you can sign AWS
/// 				Lambda deployment packages. Integrated support is provided for Amazon S3, Amazon
/// 				CloudWatch, and AWS CloudTrail. In order
/// 			to sign code, you create a signing profile and then use Signer to sign Lambda zip
/// 			files in S3.
/// 		       With code signing for IoT, you can sign code for any IoT device that is supported by AWS.
/// 			IoT code signing is available for Amazon FreeRTOS and AWS IoT Device Management, and is integrated with AWS Certificate Manager (ACM). In order to sign code, you import a third-party code-signing
/// 			certificate using ACM, and use that to sign updates in Amazon FreeRTOS and AWS IoT Device Management.
/// 		       With Signer and the Notation CLI from the Notary
/// 				Project, you can sign container images stored in a container registry such
/// 			as Amazon Elastic Container Registry (ECR). The signatures are stored in the registry
/// 			alongside the images, where they are available for verifying image authenticity and
/// 			integrity.
/// 		       For more information about Signer, see the AWS Signer Developer
/// 			Guide.
public struct Signer: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the Signer client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "Signer",
            serviceIdentifier: "signer",
            serviceProtocol: .restjson,
            apiVersion: "2017-08-25",
            endpoint: endpoint,
            serviceEndpoints: Self.serviceEndpoints,
            variantEndpoints: Self.variantEndpoints,
            errorType: SignerErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }


    /// custom endpoints for regions
    static var serviceEndpoints: [String: String] {[
        "fips-verification-us-east-1": "verification.signer-fips.us-east-1.amazonaws.com",
        "fips-verification-us-east-2": "verification.signer-fips.us-east-2.amazonaws.com",
        "fips-verification-us-gov-east-1": "verification.signer-fips.us-gov-east-1.amazonaws.com",
        "fips-verification-us-gov-west-1": "verification.signer-fips.us-gov-west-1.amazonaws.com",
        "fips-verification-us-west-1": "verification.signer-fips.us-west-1.amazonaws.com",
        "fips-verification-us-west-2": "verification.signer-fips.us-west-2.amazonaws.com",
        "verification-af-south-1": "verification.signer.af-south-1.amazonaws.com",
        "verification-ap-east-1": "verification.signer.ap-east-1.amazonaws.com",
        "verification-ap-northeast-1": "verification.signer.ap-northeast-1.amazonaws.com",
        "verification-ap-northeast-2": "verification.signer.ap-northeast-2.amazonaws.com",
        "verification-ap-south-1": "verification.signer.ap-south-1.amazonaws.com",
        "verification-ap-southeast-1": "verification.signer.ap-southeast-1.amazonaws.com",
        "verification-ap-southeast-2": "verification.signer.ap-southeast-2.amazonaws.com",
        "verification-ca-central-1": "verification.signer.ca-central-1.amazonaws.com",
        "verification-cn-north-1": "verification.signer.cn-north-1.amazonaws.com.cn",
        "verification-cn-northwest-1": "verification.signer.cn-northwest-1.amazonaws.com.cn",
        "verification-eu-central-1": "verification.signer.eu-central-1.amazonaws.com",
        "verification-eu-north-1": "verification.signer.eu-north-1.amazonaws.com",
        "verification-eu-south-1": "verification.signer.eu-south-1.amazonaws.com",
        "verification-eu-west-1": "verification.signer.eu-west-1.amazonaws.com",
        "verification-eu-west-2": "verification.signer.eu-west-2.amazonaws.com",
        "verification-eu-west-3": "verification.signer.eu-west-3.amazonaws.com",
        "verification-me-south-1": "verification.signer.me-south-1.amazonaws.com",
        "verification-sa-east-1": "verification.signer.sa-east-1.amazonaws.com",
        "verification-us-east-1": "verification.signer.us-east-1.amazonaws.com",
        "verification-us-east-2": "verification.signer.us-east-2.amazonaws.com",
        "verification-us-gov-east-1": "verification.signer.us-gov-east-1.amazonaws.com",
        "verification-us-gov-west-1": "verification.signer.us-gov-west-1.amazonaws.com",
        "verification-us-west-1": "verification.signer.us-west-1.amazonaws.com",
        "verification-us-west-2": "verification.signer.us-west-2.amazonaws.com"
    ]}


    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "signer-fips.us-east-1.amazonaws.com",
            "us-east-2": "signer-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "signer-fips.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "signer-fips.us-gov-west-1.amazonaws.com",
            "us-west-1": "signer-fips.us-west-1.amazonaws.com",
            "us-west-2": "signer-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Adds cross-account permissions to a signing profile.
    @Sendable
    @inlinable
    public func addProfilePermission(_ input: AddProfilePermissionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AddProfilePermissionResponse {
        try await self.client.execute(
            operation: "AddProfilePermission", 
            path: "/signing-profiles/{profileName}/permissions", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds cross-account permissions to a signing profile.
    ///
    /// Parameters:
    ///   - action: For cross-account signing. Grant a designated account permission to perform one or more of the following actions. Each action is associated with a specific API's operations. For more information about cross-account signing, see Using cross-account signing with signing profiles in the AWS Signer Developer Guide.
    ///   - principal: The AWS principal receiving cross-account permissions. This may be an IAM role or another
    ///   - profileName: The human-readable name of the signing profile.
    ///   - profileVersion: The version of the signing profile.
    ///   - revisionId: A unique identifier for the current profile revision.
    ///   - statementId: A unique identifier for the cross-account permission statement.
    ///   - logger: Logger use during operation
    @inlinable
    public func addProfilePermission(
        action: String,
        principal: String,
        profileName: String,
        profileVersion: String? = nil,
        revisionId: String? = nil,
        statementId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AddProfilePermissionResponse {
        let input = AddProfilePermissionRequest(
            action: action, 
            principal: principal, 
            profileName: profileName, 
            profileVersion: profileVersion, 
            revisionId: revisionId, 
            statementId: statementId
        )
        return try await self.addProfilePermission(input, logger: logger)
    }

    /// Changes the state of an ACTIVE signing profile to CANCELED.
    /// 			A canceled profile is still viewable with the ListSigningProfiles
    /// 			operation, but it cannot perform new signing jobs, and is deleted two years after
    /// 			cancelation.
    @Sendable
    @inlinable
    public func cancelSigningProfile(_ input: CancelSigningProfileRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "CancelSigningProfile", 
            path: "/signing-profiles/{profileName}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Changes the state of an ACTIVE signing profile to CANCELED.
    /// 			A canceled profile is still viewable with the ListSigningProfiles
    /// 			operation, but it cannot perform new signing jobs, and is deleted two years after
    /// 			cancelation.
    ///
    /// Parameters:
    ///   - profileName: The name of the signing profile to be canceled.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelSigningProfile(
        profileName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = CancelSigningProfileRequest(
            profileName: profileName
        )
        return try await self.cancelSigningProfile(input, logger: logger)
    }

    /// Returns information about a specific code signing job. You specify the job by using the
    /// 				jobId value that is returned by the StartSigningJob
    /// 			operation.
    @Sendable
    @inlinable
    public func describeSigningJob(_ input: DescribeSigningJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeSigningJobResponse {
        try await self.client.execute(
            operation: "DescribeSigningJob", 
            path: "/signing-jobs/{jobId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about a specific code signing job. You specify the job by using the
    /// 				jobId value that is returned by the StartSigningJob
    /// 			operation.
    ///
    /// Parameters:
    ///   - jobId: The ID of the signing job on input.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeSigningJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeSigningJobResponse {
        let input = DescribeSigningJobRequest(
            jobId: jobId
        )
        return try await self.describeSigningJob(input, logger: logger)
    }

    /// Retrieves the revocation status of one or more of the signing profile, signing job,
    /// 			and signing certificate.
    @Sendable
    @inlinable
    public func getRevocationStatus(_ input: GetRevocationStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetRevocationStatusResponse {
        try await self.client.execute(
            operation: "GetRevocationStatus", 
            path: "/revocations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "verification.", 
            logger: logger
        )
    }
    /// Retrieves the revocation status of one or more of the signing profile, signing job,
    /// 			and signing certificate.
    ///
    /// Parameters:
    ///   - certificateHashes: A list of composite signed hashes that identify certificates.
    ///   - jobArn: The ARN of a signing job.
    ///   - platformId: The ID of a signing platform.
    ///   - profileVersionArn: The version of a signing profile.
    ///   - signatureTimestamp: The timestamp of the signature that validates the profile or job.
    ///   - logger: Logger use during operation
    @inlinable
    public func getRevocationStatus(
        certificateHashes: [String],
        jobArn: String,
        platformId: String,
        profileVersionArn: String,
        signatureTimestamp: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetRevocationStatusResponse {
        let input = GetRevocationStatusRequest(
            certificateHashes: certificateHashes, 
            jobArn: jobArn, 
            platformId: platformId, 
            profileVersionArn: profileVersionArn, 
            signatureTimestamp: signatureTimestamp
        )
        return try await self.getRevocationStatus(input, logger: logger)
    }

    /// Returns information on a specific signing platform.
    @Sendable
    @inlinable
    public func getSigningPlatform(_ input: GetSigningPlatformRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSigningPlatformResponse {
        try await self.client.execute(
            operation: "GetSigningPlatform", 
            path: "/signing-platforms/{platformId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information on a specific signing platform.
    ///
    /// Parameters:
    ///   - platformId: The ID of the target signing platform.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSigningPlatform(
        platformId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSigningPlatformResponse {
        let input = GetSigningPlatformRequest(
            platformId: platformId
        )
        return try await self.getSigningPlatform(input, logger: logger)
    }

    /// Returns information on a specific signing profile.
    @Sendable
    @inlinable
    public func getSigningProfile(_ input: GetSigningProfileRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSigningProfileResponse {
        try await self.client.execute(
            operation: "GetSigningProfile", 
            path: "/signing-profiles/{profileName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information on a specific signing profile.
    ///
    /// Parameters:
    ///   - profileName: The name of the target signing profile.
    ///   - profileOwner: The AWS account ID of the profile owner.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSigningProfile(
        profileName: String,
        profileOwner: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSigningProfileResponse {
        let input = GetSigningProfileRequest(
            profileName: profileName, 
            profileOwner: profileOwner
        )
        return try await self.getSigningProfile(input, logger: logger)
    }

    /// Lists the cross-account permissions associated with a signing profile.
    @Sendable
    @inlinable
    public func listProfilePermissions(_ input: ListProfilePermissionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListProfilePermissionsResponse {
        try await self.client.execute(
            operation: "ListProfilePermissions", 
            path: "/signing-profiles/{profileName}/permissions", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the cross-account permissions associated with a signing profile.
    ///
    /// Parameters:
    ///   - nextToken: String for specifying the next set of paginated results.
    ///   - profileName: Name of the signing profile containing the cross-account permissions.
    ///   - logger: Logger use during operation
    @inlinable
    public func listProfilePermissions(
        nextToken: String? = nil,
        profileName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListProfilePermissionsResponse {
        let input = ListProfilePermissionsRequest(
            nextToken: nextToken, 
            profileName: profileName
        )
        return try await self.listProfilePermissions(input, logger: logger)
    }

    /// Lists all your signing jobs. You can use the maxResults parameter to limit the
    /// 			number of signing jobs that are returned in the response. If additional jobs remain to
    /// 			be listed, AWS Signer returns a nextToken value. Use this value in
    /// 			subsequent calls to ListSigningJobs to fetch the remaining values. You can
    /// 			continue calling ListSigningJobs with your maxResults
    /// 			parameter and with new values that Signer returns in the nextToken
    /// 			parameter until all of your signing jobs have been returned.
    @Sendable
    @inlinable
    public func listSigningJobs(_ input: ListSigningJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListSigningJobsResponse {
        try await self.client.execute(
            operation: "ListSigningJobs", 
            path: "/signing-jobs", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all your signing jobs. You can use the maxResults parameter to limit the
    /// 			number of signing jobs that are returned in the response. If additional jobs remain to
    /// 			be listed, AWS Signer returns a nextToken value. Use this value in
    /// 			subsequent calls to ListSigningJobs to fetch the remaining values. You can
    /// 			continue calling ListSigningJobs with your maxResults
    /// 			parameter and with new values that Signer returns in the nextToken
    /// 			parameter until all of your signing jobs have been returned.
    ///
    /// Parameters:
    ///   - isRevoked: Filters results to return only signing jobs with revoked signatures.
    ///   - jobInvoker: Filters results to return only signing jobs initiated by a specified IAM
    ///   - maxResults: Specifies the maximum number of items to return in the response. Use this parameter
    ///   - nextToken: String for specifying the next set of paginated results to return. After you receive a
    ///   - platformId: The ID of microcontroller platform that you specified for the distribution of your
    ///   - requestedBy: The IAM principal that requested the signing job.
    ///   - signatureExpiresAfter: Filters results to return only signing jobs with signatures expiring after a specified
    ///   - signatureExpiresBefore: Filters results to return only signing jobs with signatures expiring before a
    ///   - status: A status value with which to filter your results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listSigningJobs(
        isRevoked: Bool? = nil,
        jobInvoker: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        platformId: String? = nil,
        requestedBy: String? = nil,
        signatureExpiresAfter: Date? = nil,
        signatureExpiresBefore: Date? = nil,
        status: SigningStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListSigningJobsResponse {
        let input = ListSigningJobsRequest(
            isRevoked: isRevoked, 
            jobInvoker: jobInvoker, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            platformId: platformId, 
            requestedBy: requestedBy, 
            signatureExpiresAfter: signatureExpiresAfter, 
            signatureExpiresBefore: signatureExpiresBefore, 
            status: status
        )
        return try await self.listSigningJobs(input, logger: logger)
    }

    /// Lists all signing platforms available in AWS Signer that match the request parameters. If
    /// 			additional jobs remain to be listed, Signer returns a nextToken value.
    /// 			Use this value in subsequent calls to ListSigningJobs to fetch the
    /// 			remaining values. You can continue calling ListSigningJobs with your
    /// 				maxResults parameter and with new values that Signer returns in the
    /// 				nextToken parameter until all of your signing jobs have been
    /// 			returned.
    @Sendable
    @inlinable
    public func listSigningPlatforms(_ input: ListSigningPlatformsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListSigningPlatformsResponse {
        try await self.client.execute(
            operation: "ListSigningPlatforms", 
            path: "/signing-platforms", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all signing platforms available in AWS Signer that match the request parameters. If
    /// 			additional jobs remain to be listed, Signer returns a nextToken value.
    /// 			Use this value in subsequent calls to ListSigningJobs to fetch the
    /// 			remaining values. You can continue calling ListSigningJobs with your
    /// 				maxResults parameter and with new values that Signer returns in the
    /// 				nextToken parameter until all of your signing jobs have been
    /// 			returned.
    ///
    /// Parameters:
    ///   - category: The category type of a signing platform.
    ///   - maxResults: The maximum number of results to be returned by this operation.
    ///   - nextToken: Value for specifying the next set of paginated results to return. After you receive a
    ///   - partner: Any partner entities connected to a signing platform.
    ///   - target: The validation template that is used by the target signing platform.
    ///   - logger: Logger use during operation
    @inlinable
    public func listSigningPlatforms(
        category: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        partner: String? = nil,
        target: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListSigningPlatformsResponse {
        let input = ListSigningPlatformsRequest(
            category: category, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            partner: partner, 
            target: target
        )
        return try await self.listSigningPlatforms(input, logger: logger)
    }

    /// Lists all available signing profiles in your AWS account. Returns only profiles with an
    /// 				ACTIVE status unless the includeCanceled request field is
    /// 			set to true. If additional jobs remain to be listed, AWS Signer returns a
    /// 				nextToken value. Use this value in subsequent calls to
    /// 				ListSigningJobs to fetch the remaining values. You can continue calling
    /// 				ListSigningJobs with your maxResults parameter and with
    /// 			new values that Signer returns in the nextToken parameter until all of
    /// 			your signing jobs have been returned.
    @Sendable
    @inlinable
    public func listSigningProfiles(_ input: ListSigningProfilesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListSigningProfilesResponse {
        try await self.client.execute(
            operation: "ListSigningProfiles", 
            path: "/signing-profiles", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all available signing profiles in your AWS account. Returns only profiles with an
    /// 				ACTIVE status unless the includeCanceled request field is
    /// 			set to true. If additional jobs remain to be listed, AWS Signer returns a
    /// 				nextToken value. Use this value in subsequent calls to
    /// 				ListSigningJobs to fetch the remaining values. You can continue calling
    /// 				ListSigningJobs with your maxResults parameter and with
    /// 			new values that Signer returns in the nextToken parameter until all of
    /// 			your signing jobs have been returned.
    ///
    /// Parameters:
    ///   - includeCanceled: Designates whether to include profiles with the status of
    ///   - maxResults: The maximum number of profiles to be returned.
    ///   - nextToken: Value for specifying the next set of paginated results to return. After you receive a
    ///   - platformId: Filters results to return only signing jobs initiated for a specified signing
    ///   - statuses: Filters results to return only signing jobs with statuses in the specified
    ///   - logger: Logger use during operation
    @inlinable
    public func listSigningProfiles(
        includeCanceled: Bool? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        platformId: String? = nil,
        statuses: [SigningProfileStatus]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListSigningProfilesResponse {
        let input = ListSigningProfilesRequest(
            includeCanceled: includeCanceled, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            platformId: platformId, 
            statuses: statuses
        )
        return try await self.listSigningProfiles(input, logger: logger)
    }

    /// Returns a list of the tags associated with a signing profile resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of the tags associated with a signing profile resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) for the signing profile.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Creates a signing profile. A signing profile is a code-signing template that can be used to
    /// 			carry out a pre-defined signing job.
    ///
    @Sendable
    @inlinable
    public func putSigningProfile(_ input: PutSigningProfileRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutSigningProfileResponse {
        try await self.client.execute(
            operation: "PutSigningProfile", 
            path: "/signing-profiles/{profileName}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a signing profile. A signing profile is a code-signing template that can be used to
    /// 			carry out a pre-defined signing job.
    ///
    ///
    /// Parameters:
    ///   - overrides: A subfield of platform. This specifies any different configuration
    ///   - platformId: The ID of the signing platform to be created.
    ///   - profileName: The name of the signing profile to be created.
    ///   - signatureValidityPeriod: The default validity period override for any signature generated using this signing
    ///   - signingMaterial: The AWS Certificate Manager certificate that will be used to sign code with the new signing
    ///   - signingParameters: Map of key-value pairs for signing. These can include any information that you want to
    ///   - tags: Tags to be associated with the signing profile that is being created.
    ///   - logger: Logger use during operation
    @inlinable
    public func putSigningProfile(
        overrides: SigningPlatformOverrides? = nil,
        platformId: String,
        profileName: String,
        signatureValidityPeriod: SignatureValidityPeriod? = nil,
        signingMaterial: SigningMaterial? = nil,
        signingParameters: [String: String]? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutSigningProfileResponse {
        let input = PutSigningProfileRequest(
            overrides: overrides, 
            platformId: platformId, 
            profileName: profileName, 
            signatureValidityPeriod: signatureValidityPeriod, 
            signingMaterial: signingMaterial, 
            signingParameters: signingParameters, 
            tags: tags
        )
        return try await self.putSigningProfile(input, logger: logger)
    }

    /// Removes cross-account permissions from a signing profile.
    @Sendable
    @inlinable
    public func removeProfilePermission(_ input: RemoveProfilePermissionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RemoveProfilePermissionResponse {
        try await self.client.execute(
            operation: "RemoveProfilePermission", 
            path: "/signing-profiles/{profileName}/permissions/{statementId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes cross-account permissions from a signing profile.
    ///
    /// Parameters:
    ///   - profileName: A human-readable name for the signing profile with permissions to be removed.
    ///   - revisionId: An identifier for the current revision of the signing profile permissions.
    ///   - statementId: A unique identifier for the cross-account permissions statement.
    ///   - logger: Logger use during operation
    @inlinable
    public func removeProfilePermission(
        profileName: String,
        revisionId: String,
        statementId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RemoveProfilePermissionResponse {
        let input = RemoveProfilePermissionRequest(
            profileName: profileName, 
            revisionId: revisionId, 
            statementId: statementId
        )
        return try await self.removeProfilePermission(input, logger: logger)
    }

    /// Changes the state of a signing job to REVOKED. This indicates that the signature is no
    /// 			longer valid.
    @Sendable
    @inlinable
    public func revokeSignature(_ input: RevokeSignatureRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "RevokeSignature", 
            path: "/signing-jobs/{jobId}/revoke", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Changes the state of a signing job to REVOKED. This indicates that the signature is no
    /// 			longer valid.
    ///
    /// Parameters:
    ///   - jobId: ID of the signing job to be revoked.
    ///   - jobOwner: AWS account ID of the job owner.
    ///   - reason: The reason for revoking the signing job.
    ///   - logger: Logger use during operation
    @inlinable
    public func revokeSignature(
        jobId: String,
        jobOwner: String? = nil,
        reason: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = RevokeSignatureRequest(
            jobId: jobId, 
            jobOwner: jobOwner, 
            reason: reason
        )
        return try await self.revokeSignature(input, logger: logger)
    }

    /// Changes the state of a signing profile to REVOKED. This indicates that signatures
    /// 			generated using the signing profile after an effective start date are no longer
    /// 			valid.
    @Sendable
    @inlinable
    public func revokeSigningProfile(_ input: RevokeSigningProfileRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "RevokeSigningProfile", 
            path: "/signing-profiles/{profileName}/revoke", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Changes the state of a signing profile to REVOKED. This indicates that signatures
    /// 			generated using the signing profile after an effective start date are no longer
    /// 			valid.
    ///
    /// Parameters:
    ///   - effectiveTime: A timestamp for when revocation of a Signing Profile should become effective.
    ///   - profileName: The name of the signing profile to be revoked.
    ///   - profileVersion: The version of the signing profile to be revoked.
    ///   - reason: The reason for revoking a signing profile.
    ///   - logger: Logger use during operation
    @inlinable
    public func revokeSigningProfile(
        effectiveTime: Date,
        profileName: String,
        profileVersion: String,
        reason: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = RevokeSigningProfileRequest(
            effectiveTime: effectiveTime, 
            profileName: profileName, 
            profileVersion: profileVersion, 
            reason: reason
        )
        return try await self.revokeSigningProfile(input, logger: logger)
    }

    /// Signs a binary payload and returns a signature envelope.
    @Sendable
    @inlinable
    public func signPayload(_ input: SignPayloadRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SignPayloadResponse {
        try await self.client.execute(
            operation: "SignPayload", 
            path: "/signing-jobs/with-payload", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Signs a binary payload and returns a signature envelope.
    ///
    /// Parameters:
    ///   - payload: Specifies the object digest (hash) to sign.
    ///   - payloadFormat: Payload content type. The single valid type is
    ///   - profileName: The name of the signing profile.
    ///   - profileOwner: The AWS account ID of the profile owner.
    ///   - logger: Logger use during operation
    @inlinable
    public func signPayload(
        payload: AWSBase64Data,
        payloadFormat: String,
        profileName: String,
        profileOwner: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SignPayloadResponse {
        let input = SignPayloadRequest(
            payload: payload, 
            payloadFormat: payloadFormat, 
            profileName: profileName, 
            profileOwner: profileOwner
        )
        return try await self.signPayload(input, logger: logger)
    }

    /// Initiates a signing job to be performed on the code provided. Signing jobs are
    /// 			viewable by the ListSigningJobs operation for two years after they are
    /// 			performed. Note the following requirements:
    ///
    /// 				            You must create an Amazon S3 source bucket. For more information, see Creating a Bucket in the
    /// 						Amazon S3 Getting Started Guide.
    ///
    /// 				           Your S3 source bucket must be version enabled.
    ///
    /// 				           You must create an S3 destination bucket. AWS Signer uses your S3 destination bucket to
    /// 					write your signed code.
    ///
    /// 				           You specify the name of the source and destination buckets when calling the
    /// 						StartSigningJob operation.
    ///
    /// 				           You must ensure the S3 buckets are from the same Region as the signing profile. Cross-Region signing isn't supported.
    ///
    /// 				           You must also specify a request token that identifies your request to Signer.
    ///
    /// 		       You can call the DescribeSigningJob and the ListSigningJobs actions after you call
    /// 			StartSigningJob.
    /// 		       For a Java example that shows how to use this action, see StartSigningJob.
    @Sendable
    @inlinable
    public func startSigningJob(_ input: StartSigningJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartSigningJobResponse {
        try await self.client.execute(
            operation: "StartSigningJob", 
            path: "/signing-jobs", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Initiates a signing job to be performed on the code provided. Signing jobs are
    /// 			viewable by the ListSigningJobs operation for two years after they are
    /// 			performed. Note the following requirements:
    ///
    /// 				            You must create an Amazon S3 source bucket. For more information, see Creating a Bucket in the
    /// 						Amazon S3 Getting Started Guide.
    ///
    /// 				           Your S3 source bucket must be version enabled.
    ///
    /// 				           You must create an S3 destination bucket. AWS Signer uses your S3 destination bucket to
    /// 					write your signed code.
    ///
    /// 				           You specify the name of the source and destination buckets when calling the
    /// 						StartSigningJob operation.
    ///
    /// 				           You must ensure the S3 buckets are from the same Region as the signing profile. Cross-Region signing isn't supported.
    ///
    /// 				           You must also specify a request token that identifies your request to Signer.
    ///
    /// 		       You can call the DescribeSigningJob and the ListSigningJobs actions after you call
    /// 			StartSigningJob.
    /// 		       For a Java example that shows how to use this action, see StartSigningJob.
    ///
    /// Parameters:
    ///   - clientRequestToken: String that identifies the signing request. All calls after the first that use this
    ///   - destination: The S3 bucket in which to save your signed object. The destination contains the name
    ///   - profileName: The name of the signing profile.
    ///   - profileOwner: The AWS account ID of the signing profile owner.
    ///   - source: The S3 bucket that contains the object to sign or a BLOB that contains your raw
    ///   - logger: Logger use during operation
    @inlinable
    public func startSigningJob(
        clientRequestToken: String = StartSigningJobRequest.idempotencyToken(),
        destination: Destination,
        profileName: String,
        profileOwner: String? = nil,
        source: Source,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartSigningJobResponse {
        let input = StartSigningJobRequest(
            clientRequestToken: clientRequestToken, 
            destination: destination, 
            profileName: profileName, 
            profileOwner: profileOwner, 
            source: source
        )
        return try await self.startSigningJob(input, logger: logger)
    }

    /// Adds one or more tags to a signing profile. Tags are labels that you can use to
    /// 			identify and organize your AWS resources. Each tag consists of a key and an optional
    /// 			value. To specify the signing profile, use its Amazon Resource Name (ARN). To specify
    /// 			the tag, use a key-value pair.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds one or more tags to a signing profile. Tags are labels that you can use to
    /// 			identify and organize your AWS resources. Each tag consists of a key and an optional
    /// 			value. To specify the signing profile, use its Amazon Resource Name (ARN). To specify
    /// 			the tag, use a key-value pair.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) for the signing profile.
    ///   - tags: One or more tags to be associated with the signing profile.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes one or more tags from a signing profile. To remove the tags, specify a list of
    /// 			tag keys.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes one or more tags from a signing profile. To remove the tags, specify a list of
    /// 			tag keys.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) for the signing profile.
    ///   - tagKeys: A list of tag keys to be removed from the signing profile.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }
}

extension Signer {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: Signer, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Signer {
    /// Return PaginatorSequence for operation ``listSigningJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listSigningJobsPaginator(
        _ input: ListSigningJobsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListSigningJobsRequest, ListSigningJobsResponse> {
        return .init(
            input: input,
            command: self.listSigningJobs,
            inputKey: \ListSigningJobsRequest.nextToken,
            outputKey: \ListSigningJobsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listSigningJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - isRevoked: Filters results to return only signing jobs with revoked signatures.
    ///   - jobInvoker: Filters results to return only signing jobs initiated by a specified IAM
    ///   - maxResults: Specifies the maximum number of items to return in the response. Use this parameter
    ///   - platformId: The ID of microcontroller platform that you specified for the distribution of your
    ///   - requestedBy: The IAM principal that requested the signing job.
    ///   - signatureExpiresAfter: Filters results to return only signing jobs with signatures expiring after a specified
    ///   - signatureExpiresBefore: Filters results to return only signing jobs with signatures expiring before a
    ///   - status: A status value with which to filter your results.
    ///   - logger: Logger used for logging
    @inlinable
    public func listSigningJobsPaginator(
        isRevoked: Bool? = nil,
        jobInvoker: String? = nil,
        maxResults: Int? = nil,
        platformId: String? = nil,
        requestedBy: String? = nil,
        signatureExpiresAfter: Date? = nil,
        signatureExpiresBefore: Date? = nil,
        status: SigningStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListSigningJobsRequest, ListSigningJobsResponse> {
        let input = ListSigningJobsRequest(
            isRevoked: isRevoked, 
            jobInvoker: jobInvoker, 
            maxResults: maxResults, 
            platformId: platformId, 
            requestedBy: requestedBy, 
            signatureExpiresAfter: signatureExpiresAfter, 
            signatureExpiresBefore: signatureExpiresBefore, 
            status: status
        )
        return self.listSigningJobsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listSigningPlatforms(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listSigningPlatformsPaginator(
        _ input: ListSigningPlatformsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListSigningPlatformsRequest, ListSigningPlatformsResponse> {
        return .init(
            input: input,
            command: self.listSigningPlatforms,
            inputKey: \ListSigningPlatformsRequest.nextToken,
            outputKey: \ListSigningPlatformsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listSigningPlatforms(_:logger:)``.
    ///
    /// - Parameters:
    ///   - category: The category type of a signing platform.
    ///   - maxResults: The maximum number of results to be returned by this operation.
    ///   - partner: Any partner entities connected to a signing platform.
    ///   - target: The validation template that is used by the target signing platform.
    ///   - logger: Logger used for logging
    @inlinable
    public func listSigningPlatformsPaginator(
        category: String? = nil,
        maxResults: Int? = nil,
        partner: String? = nil,
        target: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListSigningPlatformsRequest, ListSigningPlatformsResponse> {
        let input = ListSigningPlatformsRequest(
            category: category, 
            maxResults: maxResults, 
            partner: partner, 
            target: target
        )
        return self.listSigningPlatformsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listSigningProfiles(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listSigningProfilesPaginator(
        _ input: ListSigningProfilesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListSigningProfilesRequest, ListSigningProfilesResponse> {
        return .init(
            input: input,
            command: self.listSigningProfiles,
            inputKey: \ListSigningProfilesRequest.nextToken,
            outputKey: \ListSigningProfilesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listSigningProfiles(_:logger:)``.
    ///
    /// - Parameters:
    ///   - includeCanceled: Designates whether to include profiles with the status of
    ///   - maxResults: The maximum number of profiles to be returned.
    ///   - platformId: Filters results to return only signing jobs initiated for a specified signing
    ///   - statuses: Filters results to return only signing jobs with statuses in the specified
    ///   - logger: Logger used for logging
    @inlinable
    public func listSigningProfilesPaginator(
        includeCanceled: Bool? = nil,
        maxResults: Int? = nil,
        platformId: String? = nil,
        statuses: [SigningProfileStatus]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListSigningProfilesRequest, ListSigningProfilesResponse> {
        let input = ListSigningProfilesRequest(
            includeCanceled: includeCanceled, 
            maxResults: maxResults, 
            platformId: platformId, 
            statuses: statuses
        )
        return self.listSigningProfilesPaginator(input, logger: logger)
    }
}

extension Signer.ListSigningJobsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Signer.ListSigningJobsRequest {
        return .init(
            isRevoked: self.isRevoked,
            jobInvoker: self.jobInvoker,
            maxResults: self.maxResults,
            nextToken: token,
            platformId: self.platformId,
            requestedBy: self.requestedBy,
            signatureExpiresAfter: self.signatureExpiresAfter,
            signatureExpiresBefore: self.signatureExpiresBefore,
            status: self.status
        )
    }
}

extension Signer.ListSigningPlatformsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Signer.ListSigningPlatformsRequest {
        return .init(
            category: self.category,
            maxResults: self.maxResults,
            nextToken: token,
            partner: self.partner,
            target: self.target
        )
    }
}

extension Signer.ListSigningProfilesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> Signer.ListSigningProfilesRequest {
        return .init(
            includeCanceled: self.includeCanceled,
            maxResults: self.maxResults,
            nextToken: token,
            platformId: self.platformId,
            statuses: self.statuses
        )
    }
}

// MARK: Waiters

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Signer {
    /// Waiter for operation ``describeSigningJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilSuccessfulSigningJob(
        _ input: DescribeSigningJobRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<DescribeSigningJobRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("status", expected: "Succeeded")),
                .init(state: .failure, matcher: try! JMESPathMatcher("status", expected: "Failed")),
                .init(state: .failure, matcher: AWSErrorCodeMatcher("ResourceNotFoundException")),
            ],
            minDelayTime: .seconds(20),
            command: self.describeSigningJob
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``describeSigningJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - jobId: The ID of the signing job on input.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilSuccessfulSigningJob(
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DescribeSigningJobRequest(
            jobId: jobId
        )
        try await self.waitUntilSuccessfulSigningJob(input, logger: logger)
    }
}
